Climate4Economist: an R package to comabine weather and spatial analysis with surveys

This website is meant to provide a series of tutorials to extract spatial data based on survey locations, compute weather extreme indicators, and merge them with survey data based on location and date of interview. The tutorials rely on climate4economist package, which contains functions that wrap up as many steps as possible to ensure it is easier for the user to follow.

It is not meant to be a tutorial on spatial analysis, neither a tutorial on weather data and indicators, and neither a tutorial on R. Despite, some of these aspects are describe the main purpose is to provide a guide that can be replicate with other surveys.

The target audience includes economists who may have experience with statistical software (e.g. STATA) but are less familiar with spatial data processing in R.

1 Tutorial Content

2 What do I need before starting?

2.1 You need R and Rstudio

From this web page you can download both R and Rstudio.

Note

Note that R is the actual computational software and Rstudio is the integrated development environment (IDE), a set of tools built to help you be more productive with R.

Another common alternative IDE to Rstudio is Visual Studio Code.

2.2 You need the following packages

install.packages("tidyverse")
install.packages("data.table")
install.packages("purrr")
install.packages("terra")
install.packages("sf")
install.packages("exactextractr")
install.packages("tidyterra")
install.packages("haven")
install.packages("furrr")
install.packages("SPEI")
install.packages("clock")
1
data manipulation
2
list manipulation
3
spatial data operations
4
fast extraction for polygons
5
manipulation the attribute data of spatial vector
6
handling of STATA dta
7
parallel computation
8
calculation of the Standardized Precipitation-Evapotranspiration Index
9
date and time manipulation

2.3 You need to install climate4economist

devtools::install_local(file.path("path_to_the_zip_file", "climate4economist.zip"))